<template>
	<view>
		<web-view :src="pdfUrl"></web-view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				pdfUrl: '',
				viewerUrl: '/static/pdf/web/viewer.html', //用来渲染PDF的html
			}
		},
		onLoad(option) {
			this.prviewPdf(option.url)
		},
		created() {
			this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
		},
		methods: {
			prviewPdf(url) {
				this.pdfUrl = this.viewerUrl + '?file=' + encodeURIComponent(url);
			},
		},
	}
</script>

<style>
</style>